package com.huyaanalysisplatform.mapper;

import com.huyaanalysisplatform.entity.TAreaHot;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Huadi Group 12
 * @since 2021-08-01
 */
public interface TAreaHotMapper extends BaseMapper<TAreaHot> {

//    /**
//     * 获取最近一天的数据
//     */
//    @Select({"<script>select * from t_areaHot where date >=(NOW() - interval 30 hour) order by date desc</script>"})
//    List<TAreaHot> selectOneDay();
    @Select({"<script>select * from t_areaHot where date like '2021-08-08%' order by date desc</script>"})
    List<TAreaHot> selectOneDay();

    @Select({"<script>select * from t_areaHot where date like '2021-08-07%' and areaName = '网游竞技' order by date desc</script>"})
    List<TAreaHot> selectNetGame1();

    @Select({"<script>select * from t_areaHot where date like '2021-08-08%' and areaName = '网游竞技' order by date desc</script>"})
    List<TAreaHot> selectNetGame2();

    @Select({"<script>select * from t_areaHot where date like '2021-08-07%' and areaName = '单机热游' order by date desc</script>"})
    List<TAreaHot> selectSingleGame1();

    @Select({"<script>select * from t_areaHot where date like '2021-08-08%' and areaName = '单机热游' order by date desc</script>"})
    List<TAreaHot> selectSingleGame2();

    @Select({"<script>select * from t_areaHot where date like '2021-08-07%' and areaName = '娱乐天地' order by date desc</script>"})
    List<TAreaHot> selectFunGame1();

    @Select({"<script>select * from t_areaHot where date like '2021-08-08%' and areaName = '娱乐天地' order by date desc</script>"})
    List<TAreaHot> selectFunGame2();

    @Select({"<script>select * from t_areaHot where date like '2021-08-07%' and areaName = '手游休闲' order by date desc</script>"})
    List<TAreaHot> selectPhoneGame1();

    @Select({"<script>select * from t_areaHot where date like '2021-08-08%' and areaName = '手游休闲' order by date desc</script>"})
    List<TAreaHot> selectPhoneGame2();


    /**
     * 获取所有数据
     * @return
     */
    @Select({"<script>select * from t_areaHot where date >= '2021-08-08 00:00:00' order by date desc;</script>"})
    List<TAreaHot> selectAll();
}
